﻿using ArtMath.Resource;
using System.ComponentModel;

namespace ArtMath.Attribute
{
    public class MultilingualDescriptionAttribute : DescriptionAttribute
    {
        string format;
        string[] args;
        public MultilingualDescriptionAttribute(string description) : this(null, description)
        {

        }
        //public MultilingualDescriptionAttribute(string format, string description) : this(description)
        //{
        //    this.format = format;
        //}
        public MultilingualDescriptionAttribute(string format, params string[] args)
        {
            this.format = Resources.GetFormatString(format, args.Length);
            this.args = args;
        }
        public override string Description
        {
            get
            {
                return Resources.GetLocalizedString(format, args);
            }
        }
    }
}
